//
// Created by Semir on 2020/6/1.
//

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

bool cmp(const string& a, const string& b) {
    return a + b < b + a;
}

string PrintMinNumber(vector<int> numbers) {
    vector<string> strVector(numbers.size());
    for (int i = 0; i < numbers.size(); i++) {
        strVector[i] = to_string(numbers[i]);
    }
    sort(strVector.begin(), strVector.end(), cmp);
    string res;
    for (const auto& str : strVector) {
        res.append(str);
    }
    return res;
}

int main() {
    vector<int> numbers = {3,32,321};
    string str = PrintMinNumber(numbers);
    cout << str << endl;
    return 0;
}